
class Solution:
    def minSubArrayLen(self, target: int, nums: list[int]) -> int:
        data=[0]+nums
        for i in range(1,len(data)):
            data[i]+=data[i-1]
        min_size= len(nums)
        for i, datum in enumerate(data):
            for j in range(i+1,len(data)):
                if j-i>min_size:
                    break
                if data[j]-data[i]>=target:
                    min_size=j-i
        if min_size==len(nums):
            return -1
        return min_size